﻿Imports System
Imports System.Xml
Imports System.Data
Imports MySql.Data.MySqlClient
Imports System.Security.Cryptography
Imports System.Text
Public Class Form3
    Dim conn As IDbConnection
    Dim reader As IDataReader
    Dim cmd As MySqlCommand
    Dim result As Integer

    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        Dim con As New BaseCollection
        con.ConnectionString = "server=localhost;userid=root; password=; database=dblibrarysys"
        Try
            con.Open()
            Dim sql As String
            sql = "insert into dblibrarysys.users (bookId,title,author,publisher,copyright)values('" & txtbook.Text & "','" & txttitle.Text & "','" & txtauthor.Text & "','" & txtpublisher.Text & "','" & txtcopyright.Text & "')"
            cmd = New MySqlCommand(sql, con)
            reader = cmd.ExecuteReader
            MessageBox.Show("data saved ok")
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
    End Sub

    Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub
    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub


    Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Function con() As Object
        Throw New NotImplementedException
    End Function

End Class